<#include "/admin/inc/ctx.html">
<style type="text/css">
#codeContent{
font-size:14px;
font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif;
}
</style>
<script>
var templateForm={
		sub:function(){
			var pageFormContent=$(".pageForm",navTab.getCurrentPanel());
			validateCallback(pageFormContent);
		}
}
</script>
<div class="pageContent">
	<form method="post" action="${ctx}/admin/template/addOrUpdate" class="pageForm required-validate" onsubmit="return validateCallback(this);">
		<input type="hidden" name="absolutePath" id="absolutePath" value="${(pageForm.absolutePath)! }"/>
		<input type="hidden" name="parentPath" id="absolutePath" value="${(pageForm.parentPath)! }"/>
		<div class="pageFormContent" layoutH="45">
			<p>
				<label>资源名</label> 
				<#if pageForm.absolutePath??>
				   <input type="text" id="name" name="name" value="${(pageForm.name)! }" readonly="readonly" />
				<#else>
				   <input type="text" id="name" name="name" />
				</#if>
			</p>
			<p class="nowrap" layoutH="92">
				<textarea id="codeContent" name="content" style="width: 99%;height: 95%">${(pageForm.content)! }</textarea>
			</p>
		</div>
		<div class="formBar">
			<ul>
			    <li><div class="buttonActive"><div class="buttonContent"><a  target="dialog" href="${ctx}/webapp/pages/admin/template/chooseFile.html" width="250" height="400" >引用模板</a></div></div></li>
			    <!-- <li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="templateForm.insert(2)">引用资源</button></div></div></li> -->
				<@shiro.hasPermission name="admin:template:addOrUpdate">
				<li><a class="buttonActive" href="javascript:templateForm.sub();"><span>保存</span></a></li>
				</@shiro.hasPermission>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
</div>
